package initialize

import (
	"fmt"
	"github.com/redis/go-redis/v9"
	"user_bff/global"
)

func InitRedis() {
	addr := fmt.Sprintf("%s:%d", global.ServerConfig.RedisConfig.Host, global.ServerConfig.RedisConfig.Port)
	global.RedisClient = redis.NewClient(&redis.Options{
		Addr:     addr,
		Password: global.ServerConfig.RedisConfig.Password, // no password set
		DB:       global.ServerConfig.RedisConfig.DbName,   // use default DB
	})
}
